//
//  GiftDetailViewController.m
//  FlyGift
//
//  Created by lanou3g on 15/7/16.
//  Copyright (c) 2015年 lanou3g. All rights reserved.
//

#import "GiftDetailViewController.h"

@interface GiftDetailViewController ()<UIWebViewDelegate>

@end

@implementation GiftDetailViewController

- (void)viewDidLoad {
    [super viewDidLoad];
    
    UIWebView *webView = [[UIWebView alloc]initWithFrame:self.view.bounds];
    webView.scalesPageToFit = YES;// 自动对页面进行缩放以适应屏幕
    [self.view addSubview:webView];
    
    NSURLRequest *request = [NSURLRequest requestWithURL:[NSURL URLWithString:self.giftDetailUrl]];
    [webView loadRequest:request];
    webView.dataDetectorTypes = UIDataDetectorTypePhoneNumber; // 自动检测网页上的电话号码 单击即可拨打
    
    webView.delegate = self;
}

//代理方法
- (BOOL)webView:(UIWebView *)webView shouldStartLoadWithRequest:(NSURLRequest *)request navigationType:(UIWebViewNavigationType)navigationType
{
    //返回YES，进行加载。通过UIWebViewNavigationType可以得到请求发起的原因
    return YES;
}

- (void)webViewDidStartLoad:(UIWebView *)webView
{
    //开始加载，可以加上风火轮（也叫菊花）
    NSLog(@"开始加载");
}
@end
